#!/usr/bin/env bash
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.zip
unzip elasticsearch-6.2.3.zip
cd elasticsearch-6.2.3
#设置elasticsearch运行参数
echo -e "
cluster:
  name: feishi
network:
  host: 0.0.0.0
http:
  port: 9200
">>config/elasticsearch.yml
#
sudo echo "vm.max_map_count=655360" >> /etc/sysctl.conf
#使更新配置生效
sudo sysctl -p
#启动服务
./bin/elasticsearch

#中文分词插件安装
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.2.3/elasticsearch-analysis-ik-6.2.3.zip
#重启服务后，插件生效